from hero import Timo, Jinx


class HeroFactory:
    def create_hero(hero):
         if hero == "jinx":
              return Jinx()
         elif hero == "timo":
              return Timo()
         else:
             raise Exception("此英雄不在英雄工厂当中")

hero_factory = HeroFactory()
timo = hero_factory.create_hero("timo")
jinx = hero_factory.create_hero("jinx")
timo.fight(jinx.hero_hp,jinx.hero_power,jinx.hero_name)